package com.edu.service.impl;

import com.edu.dao.UserDao;
import com.edu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Service 功能和用法 同 @Component
 *  用于 业务层
 */
@Service("userService")
public class UserServiceImpl implements UserService {



//    @Autowired
    @Resource
    private UserDao userDao;

    @Override
    public void login() {
        userDao.selectUser();
        System.out.println("执行了 UserService里的登录方法");

    }

    public UserServiceImpl() {
        System.out.println(2);
    }
}
